//懒汉模式
class SingletonLazy{
    private volatile static SingletonLazy instance = null;

    public static SingletonLazy getSingletonLazy(){
        if (instance == null) {
            synchronized (SingletonLazy.class) {
                if (instance == null) {
                    instance = new SingletonLazy();
                }
            }
        }
        return instance;
    }

    private SingletonLazy(){
    }
}

public class demo4 {
    public static void main(String[] args) {
    }
}
